Skip to content

Prover: bug fix for the invalidity prover#3138

Open
gusiri wants to merge 5 commits into
mainfrom
prover/fix-ftx
Open

Prover: bug fix for the invalidity prover#3138
gusiri wants to merge 5 commits into
mainfrom
prover/fix-ftx

Conversation

@gusiri
Copy link
Copy Markdown
Contributor

@gusiri gusiri commented May 18, 2026

This PR implements issue(s) #

Checklist

  • I wrote new tests for my new core changes.
  • I have successfully ran tests, style checker and build against my new changes locally.
  • If this change is deployed to any environment (including Devnet), E2E test coverage exists or is included in this
    PR.
  • I have informed the team of any breaking changes if there are any.

Note

Medium Risk
Medium risk because it changes invalidity circuit constraints (bad-nonce condition) and expands aggregation payload VK handling, which can affect proof validity and VK digest compatibility across setups.

Overview
Fixes invalidity proving correctness by changing the BadNonce condition (native checks, circuit constraints, and witness sanity checks) to treat a nonce as valid when tx.Nonce == account.Nonce (not account.Nonce+1), with updated test vectors.

Adds a chainID/config sanity check to invalidity proving (including limitless) that panics on mismatched transaction chainID vs [layer2].chain_id, and wires additional limitless invalidity setup inputs (VK merkle root + conglomeration VKs) into the limitless circuit builder.

Updates setup/aggregation plumbing by extending PayloadCircuits to include invalidity circuits (IDs 0–13), recognizing invalidity dummy circuits, and adding a regression test to ensure PayloadCircuits stays consistent with GlobalCircuitIDMapping; also tightens zkEVM construction to avoid overwriting memoized globals and adds a guard test.

Reviewed by Cursor Bugbot for commit 678f17c. Bugbot is set up for automated code reviews on this repo. Configure here.

gusiri added 2 commits May 18, 2026 19:57
* add missing invalidity circuits to PayloadCircuits

* add a unit test to catch missing circuits
* fix(prover): remove global overwrite in FullZKEVMWithSuite causing nil panic during setup

* test(prover): add test to ensure FullZKEVMWithSuite does not overwrite global state
@github-actions
Copy link
Copy Markdown
Contributor

linea-besu Changelog Preview (informational)

[Unreleased] diff (commits touching linea-besu/** since latest releases/linea-besu/v* tag)

[unreleased]

Generated by git-cliff-action using cliff.toml. This comment is informational and does not gate the PR.

@github-actions
Copy link
Copy Markdown
Contributor

tx-exclusion-api Changelog Preview (informational)

[Unreleased] diff (commits touching tx-exclusion-api/** since latest releases/tx-exclusion-api/v* tag)

[unreleased]

Generated by git-cliff-action using cliff.toml. This comment is informational and does not gate the PR.

Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 0b7b00f. Configure here.

case circuits.ExecutionDummyCircuitID, circuits.DataAvailabilityDummyCircuitID,
circuits.InvalidityNonceBalanceDummyCircuitID,
circuits.InvalidityPrecompileLogsDummyCircuitID,
circuits.InvalidityFilteredAddressDummyCircuitID:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New dummy circuits unhandled in getDummyCircuitParams

High Severity

isPayloadDummyCircuit now returns true for the three new invalidity dummy circuits (InvalidityNonceBalanceDummyCircuitID, InvalidityPrecompileLogsDummyCircuitID, InvalidityFilteredAddressDummyCircuitID), but getDummyCircuitParams was not updated with matching cases for these circuits. When collectPayloadVerifyingKeys calls getDummyCircuitParams for any of these, it hits the default branch and returns an error, causing setup to fail.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 0b7b00f. Configure here.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 18, 2026

prover Changelog Preview (informational)

[Unreleased] diff (commits touching prover/** since latest releases/prover/v* tag)

[unreleased]

🐛 Bug Fixes

Generated by git-cliff-action using cliff.toml. This comment is informational and does not gate the PR.

@github-actions
Copy link
Copy Markdown
Contributor

postman Changelog Preview (informational)

[Unreleased] diff (commits touching postman/** since latest releases/postman/v* tag)

[unreleased]

Generated by git-cliff-action using cliff.toml. This comment is informational and does not gate the PR.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.25%. Comparing base (e4bc01b) to head (3e1ffae).
⚠️ Report is 18 commits behind head on main.

⚠️ Current head 3e1ffae differs from pull request most recent head 065f56e

Please upload reports for the commit 065f56e to get more accurate results.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #3138   +/-   ##
=========================================
  Coverage     77.25%   77.25%           
  Complexity     7006     7006           
=========================================
  Files          1118     1118           
  Lines         44394    44394           
  Branches       5343     5343           
=========================================
  Hits          34297    34297           
  Misses         8734     8734           
  Partials       1363     1363           
Flag Coverage Δ *Carryforward flag
hardhat 96.17% <ø> (ø)
kotlin 55.90% <ø> (ø) Carriedforward from 0b7b00f
lido-governance-monitor 97.61% <ø> (ø) Carriedforward from 0b7b00f
linea-native-libs 90.69% <ø> (ø) Carriedforward from 0b7b00f
linea-shared-utils 96.18% <ø> (ø) Carriedforward from 0b7b00f
native-yield-automation-service 97.68% <ø> (ø) Carriedforward from 0b7b00f
postman 99.92% <ø> (ø) Carriedforward from 0b7b00f
sdk-core 98.09% <ø> (ø) Carriedforward from 0b7b00f
sdk-ethers 89.83% <ø> (ø) Carriedforward from 0b7b00f
sdk-viem 99.45% <ø> (ø) Carriedforward from 0b7b00f
tracer 88.55% <ø> (ø) Carriedforward from 0b7b00f

*This pull request uses carry forward flags. Click here to find out more.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Copy Markdown
Contributor

coordinator Changelog Preview (informational)

[Unreleased] diff (commits touching coordinator/** since latest releases/coordinator/v* tag)

[unreleased]

Generated by git-cliff-action using cliff.toml. This comment is informational and does not gate the PR.

@gusiri gusiri changed the title Prover: fix invalidity prover Prover: fixes for the invalidity prover May 20, 2026
@gusiri gusiri changed the title Prover: fixes for the invalidity prover Prover: bug fix for the invalidity prover May 20, 2026
gusiri and others added 3 commits May 20, 2026 21:20
…ss circuit (#3150)

The limitless invalidity builder was not extracting verification key data
from congWIOP.ExtraData, leaving CongloVK and VKMerkleRoot as zero-valued
constants in the compiled constraint system. At prove time, the actual VK
values from the conglomeration proof failed the assertIsEqual check against
these zero constants.

Extract VK octuplets from ExtraData (matching the execution limitless
builder pattern) and pass vkMerkleRoot through from setup.
)

Verify that the transaction's chainID matches the prover config
before generating invalidity proofs. This catches config mismatches
early rather than producing an invalid proof.
(cherry picked from commit 05a0dd7)

Co-authored-by: Soleimani193 <azam.soleimanian@ens.fr>
@AlexandreBelling AlexandreBelling added the Prover Tag to use for all work impacting the prover label May 21, 2026
@AlexandreBelling
Copy link
Copy Markdown
Contributor

@Soleimani193 What is the relation with your PR #3179 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Prover Tag to use for all work impacting the prover

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants